<?php
if(!isset($MAIN)){
	include_once("includes/class.ibnfm.php");
	$MAIN = new MAIN();
}
if(isset($_FILES['file_doc'])){
	$MAIN->attachments->setFile($_FILES['file_doc'], $_REQUEST['txt_cat'], tblPrefix.'registrations',$_REQUEST['txt_title']);
	?>
	<script type="text/javascript">
		document.location.href='index.php?cat=registrations&view=set&id=<?php echo($_REQUEST['txt_cat'])?>';
	</script>
	<?php
	exit();
}
if(isset($_REQUEST['del_doc'])){
	$MAIN->attachments->delFile($_REQUEST['del_doc']);
	?>
	<script type="text/javascript">
		document.location.href='?cat=registrations&view=set&id=<?php echo($_REQUEST['txt_cat'])?>';
	</script>
	<?php
	exit();
}
?>